package sk.openit.xml.helpers;

import java.util.HashMap;
import java.util.Map;

import org.xml.sax.Attributes;

public class JaxpHelpers {
	
	/**
	 * Return attributes of the XML tag based on qName.
	 * @param attributes Attributes list.
	 * @return Map(qName, value)
	 */
	public static Map<String, String> processAttributes(Attributes attributes) {
		Map<String, String> attMap = new HashMap<String, String>();
		
		for (int i = 0; i < attributes.getLength(); i++) {
			attMap.put(attributes.getQName(i), attributes.getValue(i));
		}
		
		return attMap;
	}
}
